﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs.server.utils
{
    public class Dice
    {
        private static Random _rnd = new Random();
        private readonly int _faces;

        public Dice( int faces )
        {
            _faces = faces;
        }

        public int getFaces()
        {
            return _faces;
        }

        public int roll()
        {
            return _rnd.Next( _faces ) + 1;
        }

        public int roll( int count )
        {
            int n = 0;
            for ( int i = 0; i < count; i++ )
            {
                n += roll();
            }
            return n;
        }
    }
}
